#!/bin/sh

ROOT="$HOME/positioning_workflows"
# Run etl
${ROOT}/positioning-etl/bin/cron-run.sh

# Run composite agg
${ROOT}/positioning-agg/bin/cron-run.sh /services/positioning/npsadc/positioning/data 0 0 0 3 position_service_usage wf.properties

# Run oracle loads
${ROOT}/positioning-agg/bin/cron-hdfs2db.sh 0 0 0 3 position_service_usage /services/positioning/npsadc/positioning/derived/position_service_usage
${ROOT}/positioning-agg/bin/cron-hdfs2db.sh 0 0 0 3 position_service_usageUSA2 /services/positioning/npsadc/positioning/derived/position_service_usageUSA2
${ROOT}/positioning-agg/bin/cron-hdfs2db.sh 0 0 0 3 position_service_usageUSA3 /services/positioning/npsadc/positioning/derived/position_service_usageUSA3

# Hive init.
${ROOT}/positioning-etl/bin/positioning-hive-init.sh

# Hive positioning data load
${ROOT}/positioning-etl/bin/cron-positioning-hive-addpart.sh true /services/positioning/npsadc/positioning/data positioning 0 0 0 3

# Hive agg data loads.
${ROOT}/positioning-agg/bin/cron-positioning-hive-addpart.sh false /services/positioning/npsadc/positioning/derived/position_service_usage fact_position_service_usage 0 0 0 3
${ROOT}/positioning-agg/bin/cron-positioning-hive-addpart.sh false /services/positioning/npsadc/positioning/derived/position_service_usageUSA2 fact_pos_service_usage_USA2 0 0 0 3
${ROOT}/positioning-agg/bin/cron-positioning-hive-addpart.sh false /services/positioning/npsadc/positioning/derived/position_service_usageUSA3 fact_pos_service_usage_USA3 0 0 0 3
